<template>
  <view class="work-beliefs">
    <view class="title-img-box">
      <image class="title-img" :src="partTextImgUrl" />
    </view>
    <view class="content-wrapper">
      <view class="content">
        <view class="title-box">
          <view
            class="title"
            v-for="(item, index) in dataItem.title"
            :key="index"
            >{{ item.label }}</view
          >
        </view>
      </view>
      <view class="desc-container">
        <view
          class="desc-item"
          v-for="(item, index) in dataItem.descList"
          :key="index"
        >
          <view class="title-box">
            <view :class="['line-block', 'line' + index]"></view>
            <view :class="['title', 'title' + index]">{{ item.label }}</view>
          </view>
          <view class="desc-content">
            {{ item.value }}
          </view>
        </view>
      </view>
    </view>
  </view>
</template>

<script>
export default {
  props: {
    dataItem: {
      type: Object,
      default: () => {}
    }
  },
  data() {
    return {
      partTextImgUrl:
        this.$imgBaseSelf + 'career/careerAssessNewImg/09_title.png',
      centerImg:
        this.$imgBaseSelf + 'career/careerAssessNewImg/09_center_img.png'
    };
  },
  mounted() {
    uni
      .createSelectorQuery()
      .in(this)
      .select('.work-beliefs')
      .boundingClientRect((rect) => {
        this.$emit('listenRect', rect);
      })
      .exec();
  }
};
</script>

<style lang="scss" scoped>
.work-beliefs {
  margin-top: 48rpx;
  position: relative;
  width: 100%;
  .title-img-box {
    display: flex;
    .title-img {
      height: 112rpx;
      width: 410rpx;
    }
  }

  .content-wrapper {
    margin: -14rpx 32rpx 0 32rpx;
    background: #fff;
    border-radius: 0rpx 20rpx 0rpx 0rpx;
    .content {
      padding: 60rpx 0 42rpx 42rpx;
      background: linear-gradient(0deg, #ffffff 0%, #8de5ba 100%) no-repeat;
      border-radius: 0rpx 20rpx 0rpx 0rpx;
      border: 1px solid #ffffff;
      background-size: 100% 83rpx;
      .title-box {
        height: 290rpx;
        background-image: url($img-base + 'career/careerAssessNewImg/09_center_img.png');
        background-size: 420rpx auto;
        background-repeat: no-repeat;
        background-position: center;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        .title {
          font-size: 30rpx;
          color: #fff;
          line-height: 38rpx;
          margin-top: 44rpx;
          font-weight: 600;
        }
      }
      .desc {
        margin-top: 50rpx;
        width: 592rpx;
        font-family: Source Han Sans CN;
        font-weight: 400;
        font-size: 28rpx;
        color: #555555;
        line-height: 48rpx;
      }
    }
  }
  .desc-container {
    padding: 0 42rpx 42rpx 42rpx;
    .desc-item {
      margin-top: 36rpx;
      &:first-child {
        margin-top: 16rpx;
      }
      .title-box {
        display: flex;
        .line-block {
          width: 24rpx;
          height: 20rpx;
          margin-right: 12rpx;
          margin-top: 13rpx;
        }
        .title {
          font-weight: 600;
          font-size: 30rpx;
        }
        .line0 {
          background: linear-gradient(to right, #2db279, #fff);
        }
        .line1 {
          background: linear-gradient(to right, #de82d1, #fff);
        }
        .line2 {
          background: linear-gradient(to right, #5194f9, #fff);
        }
        .title0 {
          color: #2db279;
        }
        .title1 {
          color: #de82d1;
        }
        .title2 {
          color: #5194f9;
        }
      }
      .desc-content {
        margin-top: 20rpx;
        margin-left: 34rpx;
        width: 565rpx;
        font-size: 28rpx;
        color: #555555;
        line-height: 48rpx;
      }
    }
  }
}
</style>
